/*******************************************************************
 * Copyright (C) yel_hb-USTC, 2012                                
 *                                                                  
 * FILE NAME             :  LinearClassifier.h                                 
 * PRINCIPAL AUTHOR      :  yel_hb                               
 * MODULE NAME           :  LINEARCLASSIFER                             
 * LANGUAGE              :  C++                                      
 * TARGET ENVIRONMENT    :  windows                                   
 * DATE OF FIRST RELEASE :  2012/12/30                              
 * DESCRIPTION           :  class LinearClassifer definition
 ******************************************************************/

/*
 * Revision log:
 *
 * Created by yel_hb,2012/12/30
 *
 */

#ifndef LINEARCLASSIFER_H     
#define LINEARCLASSIFER_H    1

#include "dmvector.h"

class LinearClassifier
{
public:
	LinearClassifier ();
	LinearClassifier ( int n, double e );
	DMVector get_V ();
	double get_vn ();
	double get_eta ();
	bool classify ( const DMVector& X );
	void update_weights ( const DMVector& X, bool inSide );
	void reset ();
	~LinearClassifier ();
private:
	void set_weight ( const DMVector& C, const DMVector& N);
	double sighned_dist ( const DMVector& X );
	DMVector V;
	double vn;
	double eta;
};

#endif